package cn.stylefeng.guns.modular.deduct.mapper;

import cn.stylefeng.guns.modular.deduct.entity.Deduct;
import cn.stylefeng.guns.modular.deduct.model.params.DeductParam;
import cn.stylefeng.guns.modular.deduct.model.result.DeductResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 扣费记录表 Mapper 接口
 * </p>
 *
 * @author liuqiang
 * @since 2020-02-09
 */
public interface DeductMapper extends BaseMapper<Deduct> {

    /**
     * 获取列表
     *
     * @author liuqiang
     * @Date 2020-02-09
     */
    List<DeductResult> customList(@Param("paramCondition") DeductParam paramCondition);

    /**
     * 获取map列表
     *
     * @author liuqiang
     * @Date 2020-02-09
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") DeductParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author liuqiang
     * @Date 2020-02-09
     */
    Page<DeductResult> customPageList(@Param("page") Page page, @Param("paramCondition") DeductParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author liuqiang
     * @Date 2020-02-09
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") DeductParam paramCondition);


    /**
     * 计算消费总额
     *
     * @param param
     * @return
     */
    BigDecimal sumConsumeAmount(@Param("paramCondition") DeductParam param);
}
